package DefaultNamespace;

public class CepProxy implements DefaultNamespace.Cep {
  private String _endpoint = null;
  private DefaultNamespace.Cep cep = null;
  
  public CepProxy() {
    _initCepProxy();
  }
  
  public CepProxy(String endpoint) {
    _endpoint = endpoint;
    _initCepProxy();
  }
  
  private void _initCepProxy() {
    try {
      cep = (new DefaultNamespace.CepServiceLocator()).getCep();
      if (cep != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)cep)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)cep)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (cep != null)
      ((javax.xml.rpc.Stub)cep)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public DefaultNamespace.Cep getCep() {
    if (cep == null)
      _initCepProxy();
    return cep;
  }
  
  public java.lang.String[] validaCep(int cep0) throws java.rmi.RemoteException{
    if (cep == null)
      _initCepProxy();
    return cep.validaCep(cep0);
  }
  
  
}